package cn.edu.scau.cmi.shishuai.client;

import java.util.Scanner;

import cn.edu.scau.cmi.shishuai.abstractFactory.domainAbstractClass.Meat;
import cn.edu.scau.cmi.shishuai.abstractFactory.factory.AbstractFactory;
import cn.edu.scau.cmi.shishuai.abstractFactory.factory.AonongFactory;
import cn.edu.scau.cmi.shishuai.abstractFactory.factory.TianbangFactory;
import cn.edu.scau.cmi.shishuai.abstractFactory.factory.WensFactory;

public class AbstractFactoryClient {

	public static void main(String[] args) {
		System.out.println("请选择品牌: aonong/tianbang/wens");
		@SuppressWarnings("resource")
		Scanner scanner = new Scanner(System.in);
		String brandKind = scanner.next();
		AbstractFactory factory = null;
		switch (brandKind) {
			case "aonong":
				factory = new AonongFactory();
				break;
			case "tianbang":
				factory = new TianbangFactory();
				break;
			case "wens":
				factory = new WensFactory();
				break;
			default:
				System.out.println("对不起，无此品牌");
		}

		System.out.println("请选择肉类: beef/pork/chicken");
		String productType = scanner.next();
		Meat meat = null;
		switch (productType) {
			case "beef":
				meat = factory.createBeef();
				break;
			case "pork":
				meat = factory.createPork();
				break;
			case "chicken":
				meat = factory.createChicken();
				break;
			default:
				System.out.println("对不起，无此商品");
		}
		if (meat != null) {
			meat.cook();
		}
		
	}

}
